{extend name="public:public" /}
{block name="section"}
	<link href="__ADMIN__/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
<div class="page-container" style="margin-left: 200px">
	<form action="" method="post" class="form form-horizontal" id="form-article-edi" enctype="multipart/form-data">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span> 优惠券开关：</label>
            <div class="formControls col-xs-8 col-sm-9 skin-minimal">
                <div class="radio-box">
                    <input name="allow_coupon" type="radio" value="1" id="coupon-1" {$info.allow_coupon == 1?'checked':''} >
                    <label for="coupon-1">开启</label>
                </div>
                <div class="radio-box">
                    <input name="allow_coupon" type="radio" value="0" id="coupon-2" {$info.allow_coupon == 0?'checked':''} >
                    <label for="coupon-2">关闭</label>
                </div>
            </div>
        </div>

        <!--<div class="row cl">-->
            <!--<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span> 积分开关：</label>-->
            <!--<div class="formControls col-xs-8 col-sm-9 skin-minimal">-->
                <!--<div class="radio-box">-->
                    <!--<input name="allow_points" type="radio" value="1" id="points-1" {$info.allow_points == 1 ? 'checked':''} >-->
                    <!--<label for="points-1">开启</label>-->
                <!--</div>-->
                <!--<div class="radio-box">-->
                    <!--<input name="allow_points" type="radio" value="0" id="points-2" {$info.allow_points == 0 ? 'checked':''} >-->
                    <!--<label for="points-2">关闭</label>-->
                <!--</div>-->
            <!--</div>-->
        <!--</div>-->

		<!--<div class="row cl">-->
			<!--<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>消费金额返积分比：</label>-->
			<!--<div class="formControls col-xs-8 col-sm-2">-->
				<!--<input type="text" class="input-text" value="{$info.need_rmb}" placeholder="请输入多少金额换取一积分"  name="need_rmb">-->
                <!--<div>订单总金额每{$info.need_rmb}元返1积分</div>-->
			<!--</div>-->
		<!--</div>-->

        <!--<div class="row cl">-->
            <!--<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>积分比率：</label>-->
            <!--<div class="formControls col-xs-8 col-sm-2">-->
                <!--<input type="text" class="input-text" value="{$info.ratio_points}" placeholder="请输入多少积分等于一块钱"  name="ratio_points">-->
                <!--<div>每{$info.ratio_points}积分抵现1元</div>-->
            <!--</div>-->
        <!--</div>-->

        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
             </div>
        </div>
    </form>
</div>
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__ADMIN__/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="__ADMIN__/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="__ADMIN__/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript" src="__ADMIN__/lib/webuploader/0.1.5/webuploader.min.js"></script>
<script type="text/javascript" src="__ADMIN__/lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="__ADMIN__/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
<script type="text/javascript" src="__ADMIN__/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
    $('#menu-system').children('dt').addClass('selected');
    $('#menu-system').children('dd').show();
    $('#menu-system').children('dd').find('a').eq(3).css({
        color:'#148cf1',
        backgroundColor:'#FFF'
    });
    $("#form-article-edi").validate({
        rules:{
            allow_coupon:{
                required:true,
            },
            allow_points:{
                required:true,
            },
            need_rmb:{
                required:true,
                digits:true
            },
            ratio_points:{
                required:true,
                digits:true
            },

        },
        onkeyup:false,
        focusCleanup:true,
        success:"valid",
        submitHandler:function(form){
            $(form).ajaxSubmit({
                type: 'post',
                url: "index" ,
                success: function(data){
                    layer.msg(data.msg,{icon:data.icon,time:1000},function () {
                        if(data.status == 1){
                            var index = parent.layer.getFrameIndex(window.name);
                            window.parent.location.reload();
                            parent.layer.close(index);
                        }
                    });
                },
                error: function(XmlHttpRequest, textStatus, errorThrown){
                    layer.msg('服务器错误!',{icon:2,time:1000});
                }
            });
        }
    });

</script>
{/block}
